All Questions
Tagged with powershellperformance
35 questions
1vote
1answer
59views
Find all unique file owners through Powershell in an NTFS file system
I'm trying to find all unique file owners in an NTFS file system. Getting the number is fairly straightforward, but my current approac is very inefficient: ...
2votes
1answer
166views
Powershell file parsing
I am using Powershell 7. We have the following PowerShell script that will parse some very large file. I no longer want to use 'Get-Content' as this is to slow. The script below works, but it takes a ...
3votes
1answer
1kviews
PowerShell script binary-decimal-hexadecimal-ipv4 convertor
This is a fully functional PowerShell script I wrote not long ago that converts data (numerical data) among 4 data formats: binary, decimal, hexadecimal and ipv4. It supports 12 conversions, it can ...
3votes
1answer
95views
Disk usage reporting script performing poorly with lots of files
I am running a PowerShell script that shows disk usage for drives into HTML reports. While this works quite well it has a problem on some file servers with a massive amount of files. It can sometimes ...
1vote
1answer
652views
Creating a specific distribution of random numbers in Powershell
I originally posted this on StackOverflow but was requested to post it here instead as it relates to optimization/performance of the code rather than a specific problem. TL;DR: Get-Random produces an ...
0votes
1answer
154views
Compare hostnames and leases between CSV and DHCP info
I have 3 nested loops and they do the following: Get scopes from DHCP Get hostnames from csv file Compares hostnames and leases, matches are added to a hash table There are 5 DHCP servers, 100's of ...
0votes
1answer
106views
Optimizing PowerShell string hasher method
I am building a PowerShell class based tool that works with XML files of as much as a few hundred Kb size, and as many as a hundred of these files. I have extensive validation code that is time ...
7votes
2answers
4kviews
PowerShell - fast remove a directory with 10,000+ files
I am sick of File Explorer's super slow deletion speed, so I tried to write a PowerShell script to make deletion faster, and while it does its job, its speed isn't as high as what I intended it to be. ...
1vote
1answer
184views
"Backwards Read Primes" of Codewars powershell version
Link to problem: https://www.codewars.com/kata/5539fecef69c483c5a000015/train/powershell I have a working solution in Codewars but my solution is slow for some reason and I need to improve the ...
3votes
0answers
229views
Get specific properties for all Active Directory groups and all their users, then combine them into CSV
I've written a script that gets a list of all groups in AD along with a few specific properties for each group (DistinguishedName, CN, Type, and Description). Then it goes through each group and, for ...
2votes
0answers
26views
I am gathering all the Azure subnets for Central US and trying to filter out the smaller subnets that are part of the larger... Very slow
The goal of this code is to remove subnets from the list that are redundant (included in the larger ones) It is VERY slow. Wondering how it can be sped up. At present, I’m not looking to optimize ...
4votes
0answers
87views
Powershell optimization (scripts to run simultaneously)
I need some help here, I posted on stackoverflow and was directed here, just to put things in context, I am new to PowerShell, I have a task, that in simple terms, would take a csv with more than ...
-1votes
1answer
646views
Huge performance difference: PowerShell Core vs. 5.1 [closed]
Recently I have answered another question about performance. A solution found using PowerShell-ISE successfully, and good speed testified using PowerShell Core. However, running the same script(s) in ...
0votes
2answers
2kviews
Search files content fast in powershell
I need to search a large repository of files for a specific resource, and return it only if it is used or not. It is working as expected, but it is very time consuming. To search for 50 resource ...
4votes
2answers
259views
Euler Problem 7 (finding the 10001st prime) in Powershell
I am having issue making this code more efficient. The problem to be solved is as follows: By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. ...